<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('任务延期审核')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-task-approve-edit">
        <div class="col-md-12">
            <div class="form-group">
                <label class="col-sm-2 control-label">任务标题：</label>
                <div class="col-sm-9">
                    <input type="text" th:field="*{delay.taskTitle}"  class="form-control" readonly>
                    <input id="delayId" name="delayId" th:value="${delay.delayId}" type="hidden"/>
                    <input id="taskId" name="taskId" th:value="${delay.taskId}" type="hidden"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">任务内容：</label>
                <div class="col-sm-9">
                    <textarea type="text"  multiple th:field="*{delay.content}" class="form-control"  readonly ></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">申请人员：</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control" th:value="${delay.userName}" th:field="*{delay.userName}" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">任务时间：</label>
                <div class="col-sm-9">
                    <div class="input-daterange input-group">
                        <input type="text" class="input-sm form-control" id="datetimepicker-startTime" th:field="*{delay.startTime}" placeholder="开始时间" readonly>
                        <span class="input-group-addon">-</span>
                        <input type="text" class="input-sm form-control" id="datetimepicker-endTime" placeholder="结束时间" th:field="*{delay.endTime}" readonly>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">延期时间：</label>
                <div class="col-sm-9">
                    <input type="text" class="input-sm form-control" id="datetimepicker-delayTime" th:field="*{delay.delayTime}" placeholder="延期时间" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">申请原因：</label>
                <div class="col-sm-9">
                    <textarea type="text" multiple th:field="*{delay.delayReason}" class="form-control" placeholder="请输入申请原因" readonly ></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否批准：</label>
                <div class="col-sm-9">
                    <select class="form-control select2-multiple" name="pass" id="pass" th:field="*{delay.pass}" required>
                        <option value="">请选择</option>
                        <option value="1">通过</option>
                        <option value="0">未通过</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">批准延期时间：</label>
                <div class="col-sm-9">
                    <input type="text" class="input-sm form-control" id="appointedTime" name="appointedTime" placeholder="给定延期时间" th:field="*{delay.appointedTime}" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">详细意见：</label>
                <div class="col-sm-9">
                    <textarea type="text" id="opinion" name="opinion" multiple th:field="*{delay.opinion}" class="form-control" placeholder="请输入意见" maxlength="255" ></textarea>
                </div>
            </div>
        </div>
    </form>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    var prefix = ctx + "system/task/approve";
    $('#appointedTime').datetimepicker();

    $("#form-task-approve-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-task-approve-edit').serialize());
        }
    }

</script>
</body>
</html>
